// Simple example to demonstrate the use of C-style arrays
#include <iostream>

int main()
{
  // Create two arrays of integers which contain 5 elements:
  int arr1[5] = {0,2,4,6,8};
  int arr2[5];

  // Set the values of the array:
  arr1[0] = 5;
  arr1[1] = -1;
  arr1[2] = 5;

  std::cout << *(arr1 + 1) << std::endl;

  // An array is really a pointer:
  int n;
  std::cout << "How big an array do you want? ";
  std::cin >> n;

  // An example of dynamic memory allocation:
  int *arr3 = new int[n];

  arr3[0] = 5; 
  arr3[1] = 4; 
  arr3[2] = -1;

  // Make sure to release the memory before we quit:
  delete [] arr3;

  return 0;
}
